<include file="Public:js" /> 
<div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="#">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">追溯信息</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="{:U('Qrcode/goodsList',array('supplier_id'=>$supplier_id))}" method="post">
                    <table class="search-tab">
                        <tr>
                           
                            
                            <th width="70">商品名称:</th>
                            <td><input class="common-text" placeholder="关键字" name="goods_name" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
           
                <div class="result-title">
                    <div class="result-list">
                        <!-- <a href="insert.html"><i class="icon-font"></i>新增</a>
                        <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                        <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a> -->
                        <a style="float:right;" href="{:U('Qrcode/addZhuisuInfo',array('supplier_id'=>$supplier_id,'goods_id'=>$goods_id))}"><i class="icon-font"></i>添加</a>
                         <a style="float:right;" href="javascript:history.back(-1)"><i class="icon-font"></i>返回</a>
                    </div>
                </div>
                <div class="result-content">
                
                        <form action="{:U('/Supplier/Qrcode/plchange')}" method="post">
                    <table class="result-tab" width="100%">

                        <tr>
                            <!--<th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>-->
                            <th><input type="checkbox" class="all">全选</th>
                            <th>编号</th>
                            <th>防伪码</th>
                            <th>产品名称</th>
                            <th>产品品牌</th>
                            <th>生产厂家</th>
                            <th>添加时间</th>
                            <th>二维码</th>
                            <th>查询次数</th>
                            <th>状态</th>
                            <th>有无红包</th>
                            <th>红包金额</th>
                            <th>是否领取</th>
                            
                            <th>操作</th>
                        </tr>
                        <foreach name="listinfo" item="ov"> 
                        <tr>
                            <!--<td class="tc"><input name="id[]" value="59" type="checkbox"></td>-->
                            <td>
                                <input type="checkbox" class="choose" name="choosed[]" value="{$ov.qr_id}">
                           </td>
                            <td>
                                {$ov.qr_id}
                           </td>
                            <td>{$ov.qr_sn}</td>
                            <td width='20%'>{$ov.goods_name}</td>
                            <td>{$ov.supplier_name}</td>
                            <!-- -->
                             <td>{$ov.supplier_name}</td>
                              <td>{$ov.add_time|date="Y-m-d H:i:s",###}</td>
                             <td></td>
                             <td>{$ov.y_number}</td>
                             <td><if condition="$ov.qr_start eq 1 ">冻结<else /> 正常</if></td>
                             <td>{:$ov['sf_hongbao'] == '1'?'有':'无'}</td>
                             <td>{$ov.hb_moeny}</td>
                             <td>{:$ov['sf_lq']=='1'?'已领取':'未领取'}</td>
                            
                            <td>
                                    <a class="link-update" href="{:U('Qrcode/edit_qr',array('qr_id'=>$ov['qr_id']))}">编辑</a>
                            </td>
                            
                        </tr>
                        </foreach> 
                        <tr>
                            <td colspan="6">
                                <input type="text" name="start" placeholder="防伪码编号"> --> <input type="text" name="end" placeholder="防伪码编号">

                                请选择操作：
                                <select name="type" id="type" onchange="typeget(this)">
                                    <option value="">---请选择---</option>
                                    <option value="changeg">更改防伪码商品</option>
                                    <option value="changeh">更改防伪码红包</option>
                                    
                                </select>
                            </td>
                            <td colspan="8" id="changetype">
                                
                            </td>
                        </tr>

                    </table>
                </form>
                    <div class="list-page"> {$page}</div>
                </div>
        </div>
    </div>

<script type="text/javascript">
    $('.all').click(function() {
        if($(this).is(':checked')) {
            $(':checkbox').attr('checked', 'checked');
        } else {
            $(':checkbox').removeAttr('checked');
        }
    });
</script>
<script type="text/javascript">
    function typeget(e) {
        var type = e.value;
        if (type == 'changeg') {

            // 获取该商户下的商品
             var uid = {$_SESSION['supplier'][supplier_id]};
            $.post("{:U('/Supplier/Qrcode/ajaxget')}",{supplier_id:uid},function(result){
                var html1 = "移动该组防伪码到：<select name='goods_id'><option value=''>---请选择---</option>";
                var html2 = '';
                $(result).each(function (k,v) {
                    html2 += "<option value='"+v['goods_id']+"'>"+ v['goods_name'] +"</option>";
                });
                html3 = " </select><button type='submit' class='btn btn-danger'>批量移动</button>";

                var htmlstr = '';
                htmlstr = html1 + html2 + html3;
                $("#changetype").html('');
                $("#changetype").html(htmlstr);
            });
        }
        if (type == 'changeh') {
             var htmlstr = "修改红包：<select name='sf_hongbao'><option value=''>---请选择---</option><option value='1'>有</option><option value='0'>无</option></select> <button type='submit' class='btn btn-danger'>批量修改</button>";
             $("#changetype").html('');
             $("#changetype").html(htmlstr);
        }
    };
</script>